<div id="conteudo" style="margin: 20px 0 10px 20px">
  <g:form method="post" >
    <g:hiddenField name="version" value="${vendaInstance?.version}" />
    <g:hiddenField name="id" value="${vendaInstance?.id}" />
    <fieldset class="form">
      <h3>  
        Vendedor: <g:link controller="vendedor" action="show" id="${vendaInstance?.vendedor?.id}">${vendaInstance?.vendedor?.encodeAsHTML()}</g:link>
        </br>
        Data Venda:  <g:formatDate format="dd/MM/yyyy" date="${vendaInstance?.dateCreated}" />
      </h3>
      <table id="newspaper-a">
        <thead>
          <tr>
            <th scope="col">Cod Barra</th>
            <th scope="col">Categoria</th>
            <th scope="col">Cor</th>
            <th scope="col">Modelo</th>
            <th scope="col">QTD</th>
            <th scope="col">Custo Varejo</th>
            <th scope="col">Custo Soma</th>
            <th scope="col">Remover Item</th>
          </tr>
        </thead>
        <tbody>
        <g:each in="${listProd}">
          <tr>
          <g:hiddenField name="codBarra" value="${it.produto.codBarra}"/>
          <td>${it.produto.codBarra}</td>
          <td>${it.produto.categoria}</td>
          <td>${it.produto.cor}</td>
          <td>${it.produto.modelo}</td>
          <td> <input style="width: 50px" type="text" name="total" maxlength="3" value="${it.qtdProduto}"/></td>
          <td style="text-align: right"><g:moeda valor="${it.produto.custoVarejo}"/></td>
          <td style="text-align: right"><g:moeda valor="${it.valorTotalProd}"/></td>
          <td style="text-align: center">
          <g:remoteLink controller="venda" 
                        action="excluirProduto"  
                        id="${it.id}" 
                        update="editProd">x</g:remoteLink>
          </td>
          </tr>
        </g:each>
        </tbody>
        <thead>
          <tr>
            <th></th>
            <th></th>
            <th></th>
            <th></th>
            <th></th>
            <th></th>
            <th scope="col">TOTAL DA COMPRA</th>
            <th style="text-align: right;"><g:moeda valor="${vendaInstance.valorTotal}" /></th>
        </tr>
        </thead>
      </table>
      <g:link title="ADICIONAR MAIS PRODUTOS" controller="venda" action="novosProdutos" id="${vendaInstance.id}">
        <img width="40" src="${resource(dir:'images', file:'plus.png')}"/>
      </g:link>
    </fieldset>
    <fieldset class="buttons">
      <g:actionSubmit class="save" action="update" value="Atualizar" />
      <g:actionSubmit class="list" action="list" value="Retornar" />
      <g:actionSubmit class="delete" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" formnovalidate="" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" />
    </fieldset>
  </g:form>
</div>